#列表：有序、可变、支持任意数据类型、通过索引访问

# empty_list = []
# fruits = ["apple", "banana", "cherry"]

# mixed_list = [1, "hello", 3.14, True]

# fruits.append("orange")
# print(fruits)

# fruits.insert(1, "mango")
# print(fruits)

# fruits.extend(["grape", "pear"])
# print(fruits)

# fruits.remove("banana")
# print(fruits)

# last_fruit = fruits.pop()
# print(last_fruit)
# print(fruits)

# fruits.clear()
# print(fruits)

# print(fruits)
# index = fruits.index("cherry")
# print(index)

# count = fruits.count("apple")
# print(count)

# numbers = [3, 1, 4, 2]
# numbers.sort()
# print(numbers)

# numbers.reverse()
# print(numbers)

# new_fruits = fruits.copy()
# print(new_fruits)
# fruits[0]="aaaa"
# print(fruits)
# print(new_fruits)


# subset = fruits[1:4]
# print(subset)

# squares = [x**2 for x in range(5)]
# print(squares)

# evens = [x for x in range(10) if x % 2 ==0]
# print(evens)


#----------------------------------------------------------------------------




# list1 =  [1, 2, 3, 4, 5]
# list1.append(6)
# list1.remove(3)
# list1.insert(2,99)
# print(list1)

# fruits = ["apple", "banana", "apple", "cherry", "apple", "banana"]

# num=fruits.count("apple")
# print(num)

# num1 = [x for x in range(1,21) if x %2 != 0]
# print(num1)

# list2 = [2, 4, 6, 8]
# new_list = [x**2 for x in list2 ]
# print(new_list)





